<?php if(!IS_AJAX){?>
<include file="Public:header" />
<style>
	#selectlistmember14877304351104{padding:0; margin:0;}
	#selectlistmember14877304351104 .selectitem{display:block !important; padding-left:5px;}
	#selectlistmember14877304351104 .selectitem:hover{background-color:#eee;}
	#selectlistmember14877304351104 ul{padding-left:0;}
    #selectlistmember14877304351104 ul ul{padding-left:1em;}
    #selectlistmember14877304351104 ul li{list-style-type:none; line-height:30px;}
	#selectlistmember14877304351104 ul li ul{display:none;}
	#selectlistmember14877304351104 ul li ul.open{display:block;}
	#selectlistmember14877304351104 .tree-btn{cursor: pointer;float: left;margin-top: 6px;font-style: normal;margin-left:5px;border: 1px solid #ccc;line-height: 18px;background:#fff;display: inline-block;margin-right: 5px;width:18px; height:18px; text-align:center;}
	#reselectmemberinput14877304351104:hover{border-color:#999;}
	#reselectmemberinput14877304351104{cursor:pointer;width:400px; min-height:35px; line-height:35px; border:1px solid #ccc; background:#fff; padding:0 8px; border-radius:4px;}
</style>
    <div style="display:table; width:100%;">
    <form id="databoxform" action="{:U('body')}">
         <div class="memberselect1 hidden"></div>
     </form>
<if condition="($memberInfo['isadministrator'] gt 0 || in_array($memberInfo['id'], $getManagerList)) || is_array($is_poser)">
    <div id="reselectmemberinput14877304351104l" style="display:table-cell; vertical-align:top; width:200px; border:1px solid #cdcdcd; border-right:none; background:#fff;">
		<form class="form-inline selectlist memberselect" id="selectlistmember14877304351104form" action="{:U('Team/membergroup')}">
			<div class="" style="border-radius:0; box-shadow:none;" id="reselectmember14877304351104">
				<div class="panel-body">
					<div class="row" style="margin-bottom:15px;">
						<div class="col-md-12">
							<div class="input-group">
								<input type="text" name="keywords" class="form-control" placeholder="搜索关键词">
								<span class="input-group-btn">
									<button type="submit" class="btn btn-default"><i class="fa icon-search"></i></button>
								</span>
							</div>
						</div>
					</div>
					<div id="selectlistmember14877304351104scroll" style="overflow: hidden; outline: none;width:170px;">
						<ul class="ui-sortable selectlist listloaded" id="selectlistmember14877304351104" style="overflow-x: hidden; opacity: 1;"></ul>
						<div id="selectlistmember14877304351104pages"></div>
					</div>
				</div>
			</div>
		</form>
	</div>
	<if condition="is_array($is_poser)">
	 	<script>
	 		$('<input type="hidden" value="{$is_poser[0]}" name="pos_id">').appendTo('.memberselect1');
	  	</script>
	 </if>
 <else/>
 <script>
    $('<input type="hidden" value="{$memberInfo['id']}" name="member_id">').appendTo('.memberselect1');
 </script>
 </if>
 <div style="display:table-cell; background:#f1f1f1; border:1px solid #cdcdcd; border-left:1px solid #e0e0e0;">
     <div id="databox">
     </div><div id="databoxpages"></div>
 </div>
 </div>
<include file="Public:script" />
<script src="__PUBLIC__/Intesys/AdminX/js/morris-chart/morris.js"></script>
<script src="__PUBLIC__/Intesys/AdminX/js/morris-chart/raphael-min.js"></script>
<script src="__PUBLIC__/Intesys/AdminX/js/chart-js/Chart.js"></script>
<script>
if($('.toggle-btn.menu-collapsed').length == 0){
	$('.toggle-btn').click();
}
$('#databox').ajaxlist({success:function(obj){}});
		function selectlistmember14877304351104close(){}
		function reselect14877304351104addLoadEvent(func) { 
			var oldonload = window.onload; 
				if (typeof window.onload != 'function') { 
				    window.onload = func;
				} else { 
				window.onload = function() { 
				    oldonload();
				func(); 
				} 
			} 
		}
		
		reselect14877304351104addLoadEvent(function(){
			window.onload = function() {} 
			
			$("#selectlistmemberform").addClass("binded");
			
			
			//防止多次绑定事件
			
			if(!$("#reselectmemberinput14877304351104").hasClass("binded")){
				$("#reselectmemberinput14877304351104").addClass("binded");
				$("#reselectmemberinput14877304351104").click(function(e) {
					var top = $(this).offset().top - $(document).scrollTop();
					var windowheight = $(window).height();
					var left = $(this).offset().left;
					var reselect = $("#reselectmember14877304351104");
					var reselectlayout = $("#reselectmemberlayout");
					var selectheight = reselect.height();
					if(windowheight - top - $(this).outerHeight() > reselect.outerHeight()){
						//alert(top + $(this).height());
						reselect.css({top: top + $(this).height() + "px", left: left + "px"});
					}else{
						
						reselect.css({top: top - reselect.outerHeight() + "px", left: left + "px"});
					}
					
					
					var windowwidth = $(window).width();
					var selectwidth = reselect.outerWidth();
					var left = reselect.css("left").replace("px", "")*1;
					var sw = windowwidth - (left + selectwidth);
					if(sw < 0){
						
						reselect.css({left: (left + sw) + "px"});
					}
					
					
					$("#selectlistmember14877304351104scroll").niceScroll({
                            styler: "fb",
                            cursorcolor: "#65cea7", 
                            cursorwidth: "3",
                            cursorborderradius: "0px",
                            background: "#424f63",
                            spacebarenabled: false,
                            cursorborder: "0"
                        });
					reselectlayout.show();
					reselect.show(50);
				});
			}
			
			
			
			$("#selectlistmember14877304351104").ajaxlist({success:function(){ 
				
				
				var reselect = $("#reselectmember14877304351104");
				var reselectlayout = $("#reselectmemberlayout");
				var reselectinput = $("#reselectmemberinput14877304351104");
				if(!reselectlayout.hasClass("binded")){
					reselectlayout.click(function(e) {
						reselectlayout.hide();
						reselect.hide();
					});
				}
				if(!$("#selectlistmember14877304351104").hasClass("listloaded")){
					//alert();
				$("#selectlistmember14877304351104").addClass("listloaded");
				
				}
				$("#selectlistmember14877304351104 em.tree-btn").each(function(){
					if($(this).parent().find("ul:eq(0)").length == 0){
						$(this).remove();
					}
				});
				$("#selectlistmember14877304351104 em.tree-btn").click(function(e){
					$("#selectlistmember14877304351104scroll").niceScroll({
						styler: "fb",
						cursorcolor: "#65cea7",
						cursorwidth: "3",
						cursorborderradius: "0px",
						background: "#424f63",
						spacebarenabled: false,
						cursorborder: "0"
					});
					if($(this).parent().find("ul:eq(0)").hasClass("open")){
						$(this).parent().find("ul:eq(0)").removeClass("open");
						$(this).html("+");
					}else{
						$(this).parent().find("ul:eq(0)").addClass("open");
						$(this).html("-");
					}
				});
				reselect.find(".selectitem").click(function(e){
					$("#placeholder14877304351104").remove();
					
					if(reselectinput.attr("multi") == "1"){
						var selected = new Array();
						var selectdata = $(this).find(".dataitem");
						
						if(!selectdata.hasClass("clicked")){
							selectdata.find("input[type=\"hidden\"]").each(function(){
								$(this).attr("name", "member_"+$(this).attr("name")+"[]");
							});
							selectdata.addClass("clicked");
						}
						var reselectinputc;
						selectdata.find("input[type=\"hidden\"]").each(function(){
							reselectinputc = reselectinput.find("input[value=\""+$(this).attr("value")+"\"][name=\""+$(this).attr("name")+"\"]");
							if(reselectinputc.length > 0){
								selected.push(1);
							}
						});
						
						if(selectdata.find("input[type=\"hidden\"]").length == selected.length){
							$(this).removeClass("selected");
							reselectinputc.parent().remove();
						}else{
							$(this).addClass("selected");
							reselectinput.append(selectdata.html());
						}
						reselectinput.trigger("blur");
					}else{
						reselect.find(".selectitem").removeClass("selected");
						$(this).addClass("selected");
						var selectdata = $(this).find(".dataitem");
						if(!selectdata.hasClass("clicked")){
						    selectdata.find("input[type=\"hidden\"]").each(function(){
						        $(this).attr("name", "member_"+$(this).attr("name"));
						    });
							selectdata.addClass("clicked");
						}
						
						/* 这里实现数据切换，改变 */
						$('.memberselect1').html($(this).find(".dataitem").html());
						$('.memberselect1 .member_positionline input').eq(0).attr('name','pos_name');
	                    $('.memberselect1 .member_positionline input').eq(1).attr('name','pos_id');
						$('#databoxform').submit();
						//reselectinput.html($(this).find(".dataitem").html());
						//selectlistmember14877304351104close();
						//reselectinput.trigger("blur");
					}
					reselectinput.find(".deletedata").each(function(index, element) {
						$(this).click(function(e) {
							$(this).parent().remove();
							reselectinput.trigger("blur");
							e.stopPropagation();
						});
						$(this).removeClass("deletedata");
					});
				});
			}});
		});
		/* 设置当前页面不滚动，并且让高度占满 */
		var wheight = $(window).height() - 80; 
		$('#reselectmemberinput14877304351104l').height(wheight);
		$(".sticky-header").css({overflow:'hidden', height:($(window).height())+'px'});
		$("html").getNiceScroll().remove();
		$('#sbody').height(wheight);
</script>
</body></html><?php }?>